package com.lms.demo.autoconfigure.oss;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @Author: 李孟帅
 * @CreateTime: 2020-12-25 15:37
 * @Description:
 */
@ConfigurationProperties(prefix = "lms.oss")
public class OSSProperties {
    private String endpoint;
    private String accessKeyId;
    private String secretAccessKey;

    public String getEndpoint() {
        return endpoint;
    }

    public void setEndpoint(String endpoint) {
        this.endpoint = endpoint;
    }

    public String getAccessKeyId() {
        return accessKeyId;
    }

    public void setAccessKeyId(String accessKeyId) {
        this.accessKeyId = accessKeyId;
    }

    public String getSecretAccessKey() {
        return secretAccessKey;
    }

    public void setSecretAccessKey(String secretAccessKey) {
        this.secretAccessKey = secretAccessKey;
    }

    public static Builder builder() {
        return new Builder(new OSSProperties());
    }

    public static final class Builder {

        OSSProperties ossProperties;
        public Builder(OSSProperties ossProperties){
            this.ossProperties = ossProperties;
        }
        public Builder endpoint(String endpoint) {
            ossProperties.endpoint=endpoint;
            return this;
        }

        public Builder accessKeyId(String accessKeyId) {
            ossProperties.accessKeyId=accessKeyId;
            return this;
        }

        public Builder secretAccessKey(String secretAccessKey) {
            ossProperties.secretAccessKey=secretAccessKey;
            return this;
        }

        public OSSProperties build(){
            return ossProperties;
        }
    }
}
